package d0316;

public class Employee {
    private String name;
    private  int salary;

    public Employee(String name,int salary){
        this.name = name;
        this.salary = salary;
    }
    public void setSalary(int salary) throws  DataValueException
    {
        if (salary <=2000){
            throw new DataValueException("薪资不能低于2000");
        }
        this.salary = salary;
    }

    public static void main(String[] args) {

    }
}